<#macro questionItem question>
	<#if question.id??>
		<#assign id= question.id />
	<#else>
		<#assign id= question.que_id />
	</#if>
	<div class="col-md-4 item-${id} well">
		<div class="info">
			<span class="id">${id}</span>
			<p class="title"><strong>${ellipsis(question.description, 20)}</strong></p>
			<p>${ellipsis(question.explanation, 20)}</p>

			<p><strong><i>Linked topic: </i></strong> ${question.topic.title} </p>
			<a href="<@spring.url '/questions/update/${id}' />" class="btn btn-primary">update</a>
		</div>
		<a class="delete" data-id="${id}"></a>
	</div>
</#macro>

<#macro itemItem item>
	<div class="item item-${item.id} row">
		<#if item.isCorrect == true>
			<div class="alert alert-success cf">
		<#else>
			<div class="alert alert-danger cf">
		</#if>
				<a data-id="${item.id}" class="btn btn-primary update">update</a>
				<p class="description incorrect" data-text="${item.description}">${ellipsis(item.description, 50)}</p>
		<a class="item-delete " data-id="${item.id}"></a>
		</div>
	</div>
</#macro>


<#macro getItemTemplate>
	<div class="">
		<div class="form-group">
			<label for="itemDescription">Description:</label>
			<textarea class="form-control" id="itemDescription" name="itemDescription" placeHolder="Description" rows="3" title="Item itemDescription" required="required" data-rules="maxlength:255"></textarea>
		</div>
		<div class="btn-group form-group enable-buttons" data-toggle="buttons">
		  	<label for="isCorrect" class="control-label input-group"> Correct Answer?:</label>
			<label class="btn btn-default">
				<input type="radio" name="isCorrect" value="1">yes
			</label>
			<label class="btn btn-default active">
				<input type="radio" name="isCorrect" value="0">no
			</label>
		</div>
		<div><a class="btn btn-primary save right" role="button">Save</a></div>
		<a class="delete glyphicon  glyphicon-remove" data-id=""></a>
	</div>
</#macro>

